package base.reflection_demo.demo_04;

import lombok.extern.slf4j.Slf4j;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Method;

/**
 * 读取命令行参数指定的类名,并打印出该类中包含的方法
 */
@Slf4j
public class ReflectDemo01 {

    public static void main(String[] args) throws IOException, ClassNotFoundException {
        // 比如输入 base.reflection_demo.demo_04.Person
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Class<?> clazz = Class.forName(reader.readLine());
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            log.info("{}", method.getName());
        }
    }
}
